Skip to content

Pin secure versions of test dependencies to address CVEs#2043

Closed
rchiodo wants to merge 1 commit into
microsoft:mainfrom
rchiodo:rchiodo-fix-test-requirements-cves
Closed

Pin secure versions of test dependencies to address CVEs#2043
rchiodo wants to merge 1 commit into
microsoft:mainfrom
rchiodo:rchiodo-fix-test-requirements-cves

Conversation

@rchiodo

@rchiodo rchiodo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds secure minimum-version floors for test dependencies that Component Governance flags as vulnerable. The Debugpy-Build pipeline installs tests/requirements.txt, and CG scans the resulting (transitive) dependency tree, so the fix belongs here.

CVEs addressed

CVE Package Severity Vulnerable Fixed in
CVE-2026-44431 / CVE-2026-44432 urllib3 High 2.6.0 – 2.6.x 2.7.0
CVE-2026-25645 requests Medium < 2.33.0 2.33.0
CVE-2025-71176 pytest Medium <= 9.0.2 9.0.3

Changes

  • pytest>=9.0.3
  • requests>=2.33.0
  • urllib3>=2.7.0 — pulled in transitively by requests, so an explicit floor is needed to force the secure version.

Minimum-version (>=) floors are used rather than exact pins so the suite continues to pick up future security releases.

Verification

pip install --dry-run resolves the floors to pytest 9.1.1, requests 2.34.2, urllib3 2.7.0 — all patched, no conflicts.

Notes

  • This addresses the pip/Component-Governance alerts only. The vendored components under src/debugpy/_vendored/pydevd/ are out of scope here and would be handled by a separate pydevd subrepo update.

The Debugpy-Build pipeline installs tests/requirements.txt, and Component
Governance flags vulnerable versions in the installed dependency tree.
Add secure minimum-version floors:

- pytest>=9.0.3   (CVE-2025-71176)
- requests>=2.33.0 (CVE-2026-25645)
- urllib3>=2.7.0   (CVE-2026-44431, CVE-2026-44432; transitive via requests)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rchiodo rchiodo requested a review from a team as a code owner June 24, 2026 18:09
Comment thread tests/requirements.txt
requests>=2.33.0 # CVE-2026-25645 (vulnerable < 2.33.0)
# urllib3 is pulled in transitively by requests; pin a secure floor for
# CVE-2026-44431 and CVE-2026-44432 (vulnerable 2.6.0 <= x < 2.7.0).
urllib3>=2.7.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📍 tests/requirements.txt:3-24
These packages were already unpinned before this PR, so a fresh resolve already installs the secure versions (9.1.1 / 2.34.2 / 2.7.0). The floors only document a minimum and block future downgrades — they don't change what gets installed today. If Component Governance is flagging urllib3 2.6.x, the downgrade likely originates from a lockfile, a constraints.txt, or a stale cached resolution in the Debugpy-Build pipeline that this file doesn't touch. Please confirm a real CG re-scan against the pipeline actually clears the alert rather than relying only on the local dry-run.

@heejaechang heejaechang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@rchiodo

rchiodo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@rchiodo rchiodo closed this Jun 24, 2026
rchiodo added a commit that referenced this pull request Jun 24, 2026
* Drop Python 3.9/3.8 support and pin secure test dependency floors

pytest>=9.0.3, requests>=2.33.0 and urllib3>=2.7.0 all require Python >=3.10, so they have no installable candidate on Python 3.9. Since Python 3.9 and 3.8 are EOL, drop them from the test matrix and bump the minimum supported version to 3.10, and add the CVE-driven dependency floors (supersedes #2043).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: restore x86 Windows leg on Python 3.10

* ci: drop x86 Windows leg (gevent has no cp310-win32 wheel)

The previously re-added py310_32 (32-bit Windows) leg runs
`pip install -r tests/requirements.txt` on win32 CPython 3.10. gevent
publishes no cp310-win32 wheel (only win_amd64), so pip would fall back
to a source build of gevent/greenlet/libev/c-ares and risk failing the
leg at install -- the same install-failure class this PR removes. numpy
and Cython do ship cp310-win32 wheels, but there is no reliable PEP 508
marker to drop only gevent for a 32-bit interpreter on 64-bit Windows,
so the leg is removed to keep CI green and consistent with the PR intent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align pyproject.toml lint/type targets with Python 3.10 floor

Bump [tool.pyright] pythonVersion and [tool.ruff] target-version from
3.8/py38 to 3.10/py310 (and update the comment) so the Lint stage and
pyright validate against the supported floor this PR converges on.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants